package com.pipidan.blog.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Description: 评论实体类
 * @Date: Created in 11:12 2020/6/1
 * @Author: ONESTAR
 * @QQ群: 530311074
 * @URL: https://onestar.newstar.net.cn/
 */
@Data
@TableName("t_comment")
public class Comment implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @TableId(value = "nickname")
    private String nickname;
    @TableId(value = "email")
    private String email;
    @TableId(value = "content")
    private String content;
    @TableId(value = "avatar")
    private String avatar;
    @TableId(value = "create_time")
    private Date createTime;
    @TableId(value = "blog_id")
    private Long blogId;
    @TableId(value = "parent_comment_id")
    private Long parentCommentId;
    @TableId(value = "admin_comment")
    private boolean adminComment;

    //回复评论
    @TableField(exist = false)
    private List<Comment> replyComments = new ArrayList<>();
    @TableField(exist = false)
    private Comment parentComment;
    @TableField(exist = false)
    private String parentNickname;
}